package org.xielei.designpatterns.structural.flyweight;

/**
 * FlyweightBus
 *
 * @author xielei
 * @date 2020/8/6
 */
public class ConcreteFlyweight implements AbstractFlyweight {

    private String key;

    public ConcreteFlyweight(String key) {
        this.key = key;
        System.out.println(key + " 被创建");
    }

    @Override
    public void operate(UnsharedFlyweight state) {
        System.out.println(key + " 被调用");
        System.out.println("非享元相信是：" + state.getInfo());
    }
}
